		<table class="tablelist joblist">
	    	<thead>
				<tr>
					<td width="20" class="first sectiontableheader">
						<?php echo JText::_('#');?>
					</td>
					
					<?php
	                for($i = 0, $n = count($this->fieldlist); $i < $n; $i++ ){
	                    $field = $this->fieldlist[$i];
	                    if($field->is_sortable){
	                        $header = JHTML::_('grid.sort',   JText::_($field->label), $field->sort_field_name, @$this->lists['filter_order_Dir'], @$this->lists['filter_order']);
	                    } else {
	                        $header = JText::_($field->label);
	                    }
	                    ?>	                    
	                    <td class="sectiontableheader">
	                        <?php echo  $header; ?>
	                    </td>
	                    <?php
	                }
	                ?>
	                <?php
	                
	                if($temp_user->id>0 && $this->user->id==$temp_user->id){?>
	                <td class="sectiontableheader"><?php echo JText::_('Status')?></td>
	                <td class="last sectiontableheader" width="55"><?php echo JText::_('Action');?></td>
	                <?php }?>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="<?php echo count($this->fieldlist) + 3; ?>">
						<?php if(count($items)){?>
							<?php	echo $this->pagination->getPagesLinks(); ?>
							<?php echo $this->pagination->getPagesCounter(); ?>
						<?php }?>
					</td>
				</tr>
			</tfoot>
			<tbody>
	    	<?php
	    	
	    	$k = 0;
	    	$orderNo = 0;
	    	$currentTable = '';
	    	for($i = 0, $n = count($items); $i < $n; $i++, $orderNo++){
	    		$item = $items[$i];	   
//	    		JFilterOutput::objectHTMLSafe( $item ); 
	    		$class = '';	
	    		if($item->is_hotjob==1) $class = "class='hot'";
	    		if ($i==0)
		      		$classname = 'first sectiontableentry'.($k+1);
		      	elseif ($i==$n-1)
		      		$classname = 'last sectiontableentry'.($k+1);
		      	else 
		      		$classname = 'sectiontableentry'.($k+1);
	    		?>
	    		<tr class="<?php echo $classname; ?>">
	        		<td align="center" <?php echo ($item->is_hotjob==1)?'class="first hot"':'class="first"';?>><?php echo $this->pagination->getRowOffset($i); ?></td>
	        		
	        		
	        		<?php

	                for($ii = 0, $nn = count($this->fieldlist); $ii < $nn; $ii++ ){
	                	$prefix = '';
	                	$td_classname = '';
	                	if ($ii==$nn-1)
	                		$prefix = 'last ';
	                	if($item->is_hotjob==1)
	                		$prefix = $prefix.'hot';
	                	if ($prefix!='')
	                	$td_classname = 'class="'.$prefix.'"';
	                   	$field = $this->fieldlist[$ii];
                        $field_name = $field->field_name;
                        
	                	$text = $field->truncate_length?SmartTrim::trim($item->$field_name,0,$field->truncate_length):$item->$field_name;
	                	$text = $field->clean_format?JFilterOutput::cleanText($text):$text;
	                	if ($field->field_type=='URL'&&!$field->linked)
	                	{
		                	if (substr($item->$field_name,0,7)!='http://')
		                		$value_link = 'http://'.$item->$field_name;
		                	else 
		                		$value_link = $item->$field_name;
		                	$text = '<a href="'.$value_link.'" target="_blank">'.$text.'</a>';
		                }	                	
	                	$width_column = ($field->column_width!=0)?"width=\"".$field->column_width."%\"":"";
	                   	//$nowrap = $field->no_wrap ? "":"nowrap=\"nowrap\"";	   
			    		$align="";                        
		                if($field->field_type == "boolean" ){
		                    $align = "align='center'";
		                    $text = $this->getToggleLink($field_name, $item);
		                }
		                $job_detail = '';
		                if ($jbconfig['posts']->get('posts_show_job_type') && $item->cat_id_tmp){
		                	$cat_names = getCategories($item->cat_id_tmp);
		                	if (is_array($item->cat_id))
		                		$item->cat_id = implode(',',$item->cat_id);
		                	$job_detail  = '<b>'.JText::_('Category').': </b>'.$cat_names;
		                }
		                if ($jbconfig['posts']->get('posts_show_description')){
		                	$max_length = $jbconfig['posts']->get('posts_description_chars')? $jbconfig['posts']->get('posts_description_chars'):150;
		                	$item->job_detail = htmlspecialchars_decode(substr(SmartTrim::trim($item->job_detail,0,$max_length),0,$max_length));
//		                	$filter	= new JFilterInput( '', '', 1, 1);
//		                	$item->job_detail = $filter->clean ( $item->job_detail );
		                	$job_detail .= '<br /><b>'.JText::_('Description').': </b>'.$item->job_detail;
		                }
		                if ($jbconfig['posts']->get('posts_show_posted_by') && $item->user_id){	
//		                	$creator = 	JFactory::getUser($item->user_id);
		                	$job_detail.= '<br /><b>'.JText::_('Created by').': </b>'.$item->user_id;
		                }
		                
		                if ($jbconfig['posts']->get('postsshow_days_elapsed')){
		                	$job_detail.= '<br /><b>'.JText::_('Created date').': </b>'.$item->created_date;
		                }
	                    $alias = JFilterOutput::stringURLSafe(trim($item->$field_name));                        
	                    if($field->linked){
	                        ?>
	                        <td <?php echo $align; ?> <?php //echo $nowrap; ?>  <?php echo $class;?> <?php echo $width_column; ?>>
	                        	<?php 
	                        		
                                    if($field->field_name == 'title' && getCurrentUserType() == JBJOB_SEEKER_USER){ // First field
                                        if ($this->check_stared($item->id))
                                    		echo $this->getToggleLink('is_starred', $item,true); 
                                    	else 
                                    		echo $this->getToggleLink('is_starred', $item,false); 
                                    	
                                    	
                                    }
                                ?>
	                            <span class="editlinktip hasTip" title="<?php echo htmlspecialchars($job_detail);?>">
	                            <?php if ($field->is_bold) echo '<strong>'; ?>
                                <a href="<?php echo JRoute::_( 'index.php?option='. JBCOMNAME .'&view=jajobs&layout=jaview&cid[]='.$item->id."&Itemid=". $Itemid.'&alias='.$alias ); ?>"  <?php echo $class;?>><?php echo $text; ?></a>
                                <?php if ($field->is_bold) echo '</strong>'; ?>
                                </span>
	                        </td>
	                        <?php
	                    } else {
	                    	if( $field->field_type == "DATE_CAL" || $field->field_type == "DATE"){
                        		$format = $jbconfig['general']->get("format_date", "Y-m-d");
                        		$format = str_replace("%", "", $format);
                        		if( strpos($text, " ") !== false && $jbconfig['general']->get("posts_show_published_date", "1") == "0" )
		                    			$text = date($format, strtotime($text));
                        	}
	                        ?>
	                        <td <?php echo $align; ?> <?php //echo $nowrap; ?>  <?php echo $class;?> <?php echo $width_column; ?>>
	                        <?php if ($field->is_bold) echo '<strong>'; ?>
	                            <?php echo  $text; ?>
	                        <?php if ($field->is_bold) echo '</strong>'; ?>
	                        </td>
	                        <?php
	                    }
	                }
	                
	                ?>
	                <?php if($temp_user->id>0 && $this->user->id==$temp_user->id){?>
	                <td align="center" <?php echo $class;?>>
	                	<?php echo $item->status;?>
	                </td>
	                <td align="center" <?php  echo ($item->is_hotjob==1)?'class="last hot"':'class="last"';?>>
	                	 <?php $layout = $item->is_hotjob?'japremiumform':'jaform';?>
    	                	<a href="<?php echo JRoute::_("index.php?option=$option&view=jajobs&layout=$layout&cid[]=$item->id&alias=$alias&Itemid=$Itemid");?>" title="<?php echo JText::_('Click here to edit this item')?>"><img src="<?php echo JURI::base()?>components/<?php echo $option;?>/images/icon_edit.png" title="<?php echo JText::_("Click here to edit")?>" alt="<?php echo JText::_('Edit')?>"/> </a> | 
    	                	<a href="<?php echo JRoute::_("index.php?option=$option&view=jajobs&layout=duplicate&cid[]=$item->id&alias=$alias&Itemid=$Itemid");?>" title="<?php echo JText::_('Click here to clone this item')?>"><img src="<?php echo JURI::base()?>components/<?php echo $option;?>/images/copy-16x16.png" title="<?php echo JText::_("Click here to clone this item")?>" alt="<?php echo JText::_('Clone')?>"/></a>
	                </td>
	                <?php }?>
	        	</tr>
	    	<?php
	    		$k = 1 - $k;
			}
	    	?>
	    	
	    	</tbody>
	    	
		</table>